import Page from "@/domain/bo/PageBO";
import JlPage from "@/domain/po/JlPage";
import Request from "@/api/Request";
import type GenCodeTaskVO from "@/domain/vo/GenCodeTaskVO";
import type GenCodeBO from "@/domain/bo/GenCodeBO";
import PathVariable from "@/domain/po/PathVariable";

class GenCodeTaskService {
    /**
     * 列表查询
     */
    public list(page: Page): Promise<JlPage<GenCodeTaskVO>> {
        return Request
            .build("/api/gen/code/task/pageList")
            .doGet({
                page: page.page,
                pageSize: page.pageSize
            });
    }

    /**
     * 删除
     */
    public del(ids: string[]) {
        return Request
            .build("/api/gen/code/task/del")
            .doDelete(ids);
    }

    /**
     * 代码生成
     */
    public genCode(genCodeBO: GenCodeBO) {
        return Request
            .build("/api/gen/code/mysql/gen")
            .doPost(genCodeBO);
    }
}

export default new GenCodeTaskService();